Consider the Cohomological Hall Algebra as defined by Kontsevich and Soibelman, associated with a Dynkin quiver. We reinterpret the geometry behind the multiplication map in the COHA, and give an iterated residue formula for it. We show natural subalgebras whose product is the whole COHA (except in the $E_8$ case). The dimension count version of this statement is an identity for quantum dilogarithm series, first proved by Reineke. We also show that natural structure constants of the COHA are universal polynomials representing degeneracy loci, a.k.a. quiver polynomials.